package edu.gdkm.demo3;
//汉诺塔问题
public class Test5 {
    //将n个盘子从a柱，借助b柱，移动到c柱上
    public static void hanno(int n,String a,String b,String c){
        if(n==1){
            System.out.println(a+"-->"+c);
        }else{
            hanno(n-1,a,c,b);
            System.out.println(a+"-->"+c);
            hanno(n-1,b,a,c);
        }
    }

    public static void main(String[] args) {
        hanno(4,"A","B","C");
    }
}
